<form class="layui-form" action="{:url()}" method="post" id="editForm">
    <div class="layui-form-item">
        <label class="layui-form-label">所属门店</label>
        <div class="layui-input-inline w200">
            <select name="shop_id" class="field-shop_id" type="select" >
                <option value="">请选择</option>
                {$shop|raw}
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux">
            财务和大区经理、总经理,此处请留空
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">管理员姓名</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-nick" name="nick" lay-verify="required" autocomplete="off" placeholder="请输入管理员姓名">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">登录账号</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-username" name="username" lay-verify="required" autocomplete="off" placeholder="请输入用户名">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">登陆密码</label>
        <div class="layui-input-inline">
            <input type="password" class="layui-input" name="password" lay-verify="password" autocomplete="off" placeholder="******">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">确认密码</label>
        <div class="layui-input-inline">
            <input type="password" class="layui-input" name="password_confirm" autocomplete="off" placeholder="******">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系邮箱</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-email" name="email" autocomplete="off" placeholder="请输入邮箱地址">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">联系手机</label>
        <div class="layui-input-inline">
            <input type="text" class="layui-input field-mobile" name="mobile" autocomplete="off" placeholder="请输入手机号码">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">默认布局</label>
        <div class="layui-input-inline">
            <input type="radio" class="field-iframe" name="iframe" value="0" title="单页" checked>
            <input type="radio" class="field-iframe" name="iframe" value="1" title="框架">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">启用状态</label>
        <div class="layui-input-inline">
            <input type="radio" class="field-status" name="status" value="1" title="启用" checked>
            <input type="radio" class="field-status" name="status" value="0" title="禁用">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">职位</label>
        <div class="layui-input-inline">
            <select name="type" class="field-type" type="select" lay-verify="required">
                <option value="0" {if isset($formData['type']) && $formData['type'] == '管理员'} selected {/if}>管理员</option>
                <option value="1" {if isset($formData['type']) && $formData['type'] == '区域经理'} selected {/if}>区域经理</option>
                <option value="2" {if isset($formData['type']) && $formData['type'] == '店长'} selected {/if}>店长</option>
                <option value="3" {if isset($formData['type']) && $formData['type'] == '前台'} selected {/if}>前台</option>
                <option value="4" {if isset($formData['type']) && $formData['type'] == '库管'} selected {/if}>库管</option>
                <option value="5" {if isset($formData['type']) && $formData['type'] == '顾问'} selected {/if}>顾问</option>
                <option value="6" {if isset($formData['type']) && $formData['type'] == '财务'} selected {/if}>财务</option>
                <option value="7" {if isset($formData['type']) && $formData['type'] == '美容师'} selected {/if}>美容师</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">角色分组</label>
        <div class="layui-input-block">
            {foreach name="roles" id="r" key="k"}
                <input type="checkbox" class="field-role_id" name="role_id[]" value="{$k}" title="{$r}" lay-skin="primary" />
            {/foreach}
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            {:token()}
            <input type="hidden" class="field-id" name="id">
        </div>
    </div>
    <div class="pop-bottom-bar">
        <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="formSubmit" hisi-data="{pop: true, refresh: true}">提交保存</button>
        <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
    </div>
    </form>
    {include file="block/layui" /}
    <script>
    var formData = {:json_encode($formData)};
    layui.use(['form', 'func'], function() {

        var $ = layui.jquery, form = layui.form;
        layui.func.assign(formData);

    });
    </script>
